package o.json;

public abstract class JSONValue {
	public static final JSONValue TRUE  = new JSONTrue();
	public static final JSONValue FALSE = new JSONFalse();
	public static final JSONValue NULL  = new JSONNull();

	public boolean isString() { return false; }
	public JSONString getString() throws JSONException { throw new JSONException("value is not a string!"); }
	public boolean isNumber() { return false; }
	public JSONNumber getNumber() throws JSONException { throw new JSONException("value is not a number!"); }
	public boolean isObject() { return false; }
	public JSONObject getObject() throws JSONException { throw new JSONException("value is not an object!"); }
	public boolean isArray() { return false; }
	public JSONArray getArray() throws JSONException { throw new JSONException("value is not an array!"); }
	public boolean isTrue() { return false; }
	public JSONTrue getTrue() throws JSONException { throw new JSONException("value is not true!"); }
	public boolean isFalse() { return false; }
	public JSONFalse getFalse() throws JSONException { throw new JSONException("value is not false!"); }
	public boolean isNull() { return false; }
	public JSONNull getNull() throws JSONException { throw new JSONException("value is not null!"); }

	@Override
	public boolean equals(Object object) {
		return false;
	}
}
